prepare("select * from admin where username = '$username'") ; $chk->execute(); if($chk->rowcount() > 0) { $msg = "An Admin with this $username already Exist, Please Use another Username" ; } } if(empty($msg)) { if($user->createAdmin($username,$pwd,$code)) { $msg = "Admin Created Successfully" ; } } } ?>